//
//  BaseViewController.swift
//  sxwb
//
//  Created by TianDu on 2016/11/11.
//  Copyright © 2016年 TianDu. All rights reserved.
//

import UIKit

class BaseViewController: UITableViewController {

    var islogin:Bool = UserAccountTool().isLogin
    
    let visitorView = VisitorView.createView()
    
    override func loadView() {
        // 判断是否加载访客视图
        islogin ? super.loadView() : loadVisitorView()
    }
    
    func loadVisitorView() {
        
        view = visitorView
        
        visitorView.registerBtn.addTarget(self, action: #selector(goRegister), for: .touchUpInside)
        visitorView.loginBtn.addTarget(self, action: #selector(goLogin), for: .touchUpInside)
    }
    
    func goRegister() {
        
        print("注册")
    }
    
    func goLogin() {
        
        print("登录")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // MARK: - Table view data source

    override func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 0
    }

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return 0
    }



}
